import getApiData from "@/services/cpasRequest";

// 获取账套
export async function getAccountInfo(params: {
  dbname: string;
}) {
  if (!params.dbname) return [];
  const res = await getApiData("account.accountInfo.getDataList", params);
  if (res.ok) {
    return Promise.resolve({
      data: res.data,
      success: true,
    });
  }
  return Promise.resolve({
    data: [],
    success: false,
  });
}

// // 重新算调整数
export async function ZBAdjust(whereFrom: string, params: {
  dbname: string;
  Data_ID: string;
  editUser: string,
}) {
  let requsetName = '';
  if (whereFrom === "账表调整") {
    requsetName = 'account.ZBAdjust.recal';
  } else {
    requsetName = 'account.auditAdjust.recal';
  }

  const res = await getApiData(requsetName, params);
  if (res.ok) return res.ok;
}